/**
 * Author@ Cheng Feitian
 * Date: 2021-4-2
 * Description: 关系运算符重载
 */

#include <algorithm>
#include <iostream>
#include <string>

using namespace std;
const int maxn = 1024;

class Person
{
public:
    int m_Age;
    string m_Name;

    Person(string name,int age)
    {
        m_Name = name;
        m_Age = age;
    }

    bool operator>(Person &p)
    {
        if (this->m_Age > p.m_Age)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
};

void test01()
{
    Person p1("Cheng",10);
    Person p2("Cheng",20);

    if (p1 > p2)
    {
        cout << "p1的年龄比p2大" << endl;
    }
    else
    {
        cout << "p1的年龄比p2小" << endl;
    }
}

int main()
{
    test01();
    return 0;
}
